package com.legendary.awesome.utilities;

public class Validator {
	
	public final String email_pattern = "";
	public final String phonenr_pattern = "";
	
	public Validator()
	{
		
	}
	
	public boolean validateInputData(String name, String address, String email, String phonenr)
	{
		if(name.trim().equals(""))
		{
			return false;
		}
		
		if(phonenr.trim().equals(""))
		{
			return false;
		}
		else if(!isANumber(phonenr.trim()))
		{
			return false;
		}
		else if(phonenr.trim().length() > 20)
		{
			return false;
		}
		
		return true;
	}
	
	public boolean isANumber(String num)
	{
		try
		{
			Long.parseLong(num);
		}
		catch(Exception e)
		{
			return false;
		}
		
		return true;
	}
}